﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using EF4Models;

namespace AstoriaDemo {
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IMusicService" in both code and config file together.
    /// <summary>
    /// Interface cho WCF Service
    /// </summary>
    [ServiceContract]
    public interface IMusicService {
        [OperationContract]
        EF4Models.Artist getAnArtist(int ArtistID);

        [OperationContract]
        void EditArtistName(int ArtistID, string newName);

        [OperationContract]
        void UpdateArtist(Artist artist);

        [OperationContract]
        GenreGroup[] runSQLQuery(string query);

        [OperationContract]
        dynamic runDynamicSQLQuery(string query);
    }
    /// <summary>
    /// Điểm dở của WCF Service là trả về một kiểu dữ liệu nào lạ nào thì phải
    /// định nghĩa 
    /// </summary>
    [DataContract]
    public class GenreGroup {
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public int count_num { get; set; }
    }
}
